Skip to main content

Overview

The USGS Astrogeology Science Center provides Web Map Service (WMS) endpoints for planetary data. This guide demonstrates how to access these services using GDAL configuration files and web mapping libraries.

GDAL WMS Configuration

Overview

GDAL can retrieve images from WMS layers using XML configuration files, enabling command-line access to planetary base maps and elevation data.

Basic Usage

This command retrieves data from a WMS layer and exports it as a PNG image.

WMS Configuration Files

Mars MDIM 2.1 Mosaic

Access the Mars Digital Image Mosaic (MDIM 2.1):
Key Parameters:
  • ServerUrl: WMS endpoint URL
  • Layers: Layer name (MDIM21)
  • ImageFormat: image/jpeg for RGB imagery
  • BandsCount: 3 (RGB)
  • DataType: Byte (8-bit)

Mars MOLA Elevation

Access Mars Orbiter Laser Altimeter (MOLA) elevation data:
Key Parameters:
  • ImageFormat: image/tiff for elevation data
  • BandsCount: 1 (elevation only)
  • DataType: Int16 (16-bit signed integer)

Moon LOLA Elevation

Access Lunar Orbiter Laser Altimeter (LOLA) elevation data:

GDAL WMS Usage Examples

Export Specific Region

Create a configuration file with your desired extent:
Then export:

Get Dataset Information

Output shows:
  • Coordinate system
  • Pixel size
  • Bounding box
  • Data type
  • Band information

Reproject WMS Data

Create Hillshade from Elevation WMS

OpenLayers Example

Interactive Moon Map

HTML template for displaying lunar WMS layers with OpenLayers:

Available Lunar Layers

LOLA_color

Color-coded elevation visualization

LOLA_steel

Grayscale elevation (steel colormap)

LOLA_bw

Black and white shaded relief

LROC_WAC

Wide Angle Camera mosaic

UVVIS

Clementine UVVIS mosaic

KaguyaTC_Ortho

JAXA Kaguya Terrain Camera

LO

Lunar Orbiter mosaic

Leaflet Example

Modern Lunar Web Map

Lightweight alternative using Leaflet:

Adding GeoJSON Overlay

Include region of interest as GeoJSON:

Custom Styling for GeoJSON

Available WMS Endpoints

USGS Astrogeology WMS Services

Base URL: http://planetarymaps.usgs.gov/cgi-bin/mapserv?map=/maps/earth/moon_simp_cyl.mapAvailable Layers:
  • LOLA_color - LOLA elevation (color)
  • LOLA_steel - LOLA elevation (steel)
  • LOLA_bw - LOLA elevation (grayscale)
  • LROC_WAC - LROC Wide Angle Camera
  • uv_v2 - Clementine UVVIS v2
  • KaguyaTC_Ortho - Kaguya Terrain Camera
  • LO - Lunar Orbiter
Elevation URL: http://wms.wr.usgs.gov/cgi-bin/mapserv?map=/maps/earth/moon_simp_cyl_elev.map
  • LOLA_elev - LOLA elevation (Int16)
For a complete list of available layers, visit the USGS Astro Web Map Atlas

GetCapabilities Requests

Query Available Layers

Get WMS capabilities to discover all available layers:
This returns an XML document listing:
  • Available layers
  • Supported formats
  • Coordinate systems
  • Bounding boxes
  • Layer metadata

Parse Capabilities with Python

Advanced Techniques

Transparent Overlays

Combine base imagery with transparent overlays:

Time Series Animation

For temporal datasets with time parameter support:

GetFeatureInfo Requests

Query pixel values from WMS layers:

Performance Optimization

Tile Caching

For repeated access, consider setting up a local tile cache using MapProxy or TileCache to reduce server load and improve performance.
MapProxy Configuration Example:

Request Optimization

Troubleshooting

Common Issues

Issue: “Service not found” error
Solution: Verify the map file path in ServerUrl is correct
Issue: Blank tiles or no data
Solution: Check DataWindow coordinates are within valid range (Lon: -180 to 360, Lat: -90 to 90)
Issue: Slow performance
Solution: Reduce SizeX/SizeY values, use appropriate image format (JPEG for imagery, TIFF for elevation)
Issue: Coordinate system mismatch
Solution: Ensure EPSG:4326 is specified in both Service/SRS and Projection elements

Source Files Reference

  • gdal_MDIM21.xml - Mars MDIM 2.1 configuration
  • gdal_mars_MOLA_elev.xml - Mars MOLA elevation configuration
  • gdal_moon_LOLA_elev.xml - Moon LOLA elevation configuration
  • OpenLayers_MyMoon.html - OpenLayers implementation example
  • leaflet_moonWMS2_wGeoJSON_Box.html - Leaflet implementation example

Additional Resources

USGS Astro Web Maps

Complete layer catalog and documentation

GDAL WMS Driver

GDAL WMS driver documentation

OpenLayers API

OpenLayers documentation and examples

Leaflet Documentation

Leaflet API reference and tutorials

See Also